﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using UtilityExtensions;
using BOL;
using DAL;

namespace UILGestion.AlmacenAdmin
{
    public partial class NotaSalidaListGrid : System.Web.UI.UserControl
    {
        public event EventHandler DataBound;

        public int pagesize { get { return Util.GetPageSizeCookie(); } }
        protected void Page_Load(object sender, EventArgs e)
        {
            pager.PageSize = pagesize;

        }

        public override void DataBind()
        {
        ListView1.DataBind();
        }
        public string DataSourceID
        {
            set { ListView1.DataSourceID = value; }
        }
        public object DataSource
        {
            set { ListView1.DataSource = value; }
        }

        protected void ListView1_DataBound(object sender, EventArgs e)
        {
            if (DataBound != null)
                DataBound(sender, e);
        }
        public DataPager DataPager
        {
            get { return pager; }
        }
        public int TopRolId
        {
            get { return (int)ListView1.DataKeys[0].Value; }
        }

        protected void ListView1_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            if (e.Item.ItemType == ListViewItemType.DataItem)
            {
                var link = e.Item.FindControl("HyperLink1") as HyperLink;
                var r = e.Item as ListViewDataItem;
                var d = r.DataItem as NotaIngresoListInfo;
                //link.NavigateUrl ="javascript:PageMethods.ToggleTag({0},'{1}',ToggleTagCallback)".Fmt(d.idInternal, link.ClientID);

              
            }
        }

    }
}